package com.example.lenovo.a32ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class EditTextTest extends AppCompatActivity implements View.OnClickListener {

    private Button mButton;
    private EditText mEditText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.edittext_layout);

        mButton = findViewById(R.id.btn_getData);

        mEditText = findViewById(R.id.edit_text);

        mButton.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_getData: {
                String inputString = mEditText.getText().toString();
                Toast.makeText(this,inputString,Toast.LENGTH_SHORT).show();
                break;
            }
            default:
        }
    }
}

